package com.atguigu.dga.util;

import com.atguigu.dga.governance.bean.AssessParam;
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class HttpUtil {

    static  OkHttpClient okHttpClient=new OkHttpClient();


    public static  String get(String url) throws  Exception {


        Request request = new Request.Builder().url(url).get().build();
        Call call = okHttpClient.newCall(request);

        Response response = call.execute();

        return response.body().string();

    }

    public static void main(String[] args) throws Exception {
        String json = get("http://hadoop102:18080/api/v1/applications/application_1684083580862_0012/1/stages/1");

        System.out.println("json = " + json);
    }
}
